﻿using System;
using System.Linq;

namespace task2
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rand = new Random();
            int[] numbers = Enumerable.Range(0, 100)
                                       .Select(i => rand.Next(0, 1000))
                                       .ToArray();

            var sortedNumbers = numbers.OrderByDescending(n => n);
            int sum = sortedNumbers.Sum();
            double average = sortedNumbers.Average();

            Console.WriteLine($"Sorted numbers: {string.Join(", ", sortedNumbers)}");
            Console.WriteLine($"Sum: {sum}");
            Console.WriteLine($"Average: {average}");
        }
    }
}
